local skynet = require "skynet"
require "skynet.manager"
local log = require "sky_log"
local handle_config = require "handle_boyaa_config"
local queue = require "skynet.queue"
local Queue = queue()

local M = {
    --config原始数据
    plat_config_raw = {},
    --标准化字段后的配置数据
    plat_config = {},
    --桌子信息
    plat_table_config = {},
}

--============================= Init =============================--
function M:init()
    skynet.register(".config")

    --config&&dbs
    handle_config.init_config(self)
    log.info("plat_config=", self.plat_table_config)
end


skynet.start(function ()
    skynet.dispatch("lua", function(session, address, cmd, ...)
        local f = M[cmd]
        if f then
            skynet.ret(skynet.pack( Queue(f, M, ...) ) )
        else
            error(string.format("Unknown command %s", tostring(cmd)))
        end
    end)

    M:init()
end)


return M